package com.open.capacity.workflow3.service;

import com.open.capacity.model.system.SysUser;
import com.open.capacity.workflow3.engine.NwfUserInfo;
import com.open.capacity.workflow3.entity.NwfProcess;

import com.open.capacity.commons.PageResult;
import com.open.capacity.workflow3.entity.NwfProcessDetailsModel;
import com.open.capacity.workflow3.entity.NwfTask;

import java.util.Map;
import java.util.List;

/**
 * @author
 * @email
 * @date 2023-11-02 21:21:15
 */
public interface NwfProcessService {

    NwfProcess findById(String id);

    PageResult<NwfProcess> getPageList(Map<String, Object> params);

    PageResult<NwfProcess> getMyPageList(String userId, Map<String, Object> params, String schemeCode);

    PageResult<NwfProcess> getMyTaskPageList(SysUser userInfo, Map<String, Object> params, String schemeCode, Boolean isBatchAudit);

    PageResult<NwfProcess> getMyFinishTaskPageList(SysUser userInfo, Map<String, Object> params, String schemeCode);

    void delete(String processId);

    Map<String, List<NwfUserInfo>> getNextAuditors(String code, String processId, String taskId, String nodeId, String operationCode, SysUser userInfo);

    NwfProcessDetailsModel getProcessDetails(String processId, String taskId, SysUser userInfo);

    NwfProcessDetailsModel getChildProcessDetails(String processId, String taskId, String schemeCode, String nodeId, SysUser userInfo);

    void saveDraft(String processId, String schemeCode, SysUser userInfo);

    void deleteDraft(String processId, SysUser userInfo);

    void createFlow(String schemeCode, String processId, String processTitle, Integer processLevel, String auditors, SysUser userInfo);

    void createChildFlow(String schemeCode, String processId, String parentProcessId, String parentTaskId, SysUser userInfo);

    void againCreateFlow(String processId, SysUser userInfo);

    void auditFlow(String operationCode, String operationName, String processId, String taskId, String des, String auditors, String stamp, String signUrl, SysUser userInfo);

    void auditFlows(String operationCode, String taskIds, SysUser userInfo);

    void signFlow(String processId, String taskId, String userId, String des, SysUser userInfo);

    void signAuditFlow(String operationCode, String processId, String taskId, String des, SysUser userInfo);

    void referFlow(String processId, String taskId, SysUser userInfo);

    void urgeFlow(String processId, SysUser userInfo);

    void revokeFlow(String processId, SysUser userInfo);

    Boolean revokeAudit(String processId, String taskId, SysUser userInfo);

    void makeTaskTimeout();

    List<NwfTask> getTaskUserList(String processId);

    void appointUser(List<NwfTask> list, SysUser userInfo);

    void deleteFlow(String processId, SysUser userInfo);

    void addTask(String processId, String bNodeId, String eNodeId, SysUser userInfo);

    String getMySql();

    String getMyTaskSql(SysUser userInfo, Boolean isBatchAudit);

    String getMyFinishTaskSql();
}

